package com.cb.eduservice.client;

import com.cb.eduservice.client.impl.OrderDegradeFeignClient;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "service-order",fallback = OrderDegradeFeignClient.class)
public interface OrdersClient {

    /**
     * 根据课程id和用户id, 查询当前课程是否已经购买
     * @param courseId
     * 课程id
     * @param memberId
     * 用户id
     * @return
     * true: 已支付, false: 未支付
     */
    @GetMapping("/orderservice/order/isBuyCourse/{courseId}/{memberId}")
    boolean isBuyCourse(@PathVariable("courseId") String courseId,
                       @PathVariable("memberId") String memberId);
}
